/* 暗黑主题基础修复 - 简化版本 */

/* 确保深色主题标识 */
html.dark {
  color-scheme: dark;
}

/* 基础页面样式 */
html.dark {
  background-color: #0f172a !important;
}

html.dark body {
  background-color: #0f172a !important;
  color: #ffffff !important;
}

/* 基础文本颜色 */
html.dark h1, html.dark h2, html.dark h3, 
html.dark h4, html.dark h5, html.dark h6,
html.dark p, html.dark span, html.dark div, 
html.dark label, html.dark a {
  color: #ffffff !important;
}

/* 布局组件背景 */
html.dark .layout-wrapper,
html.dark .layout-grid,
html.dark .layout-sidebar,
html.dark .layout-header,
html.dark .layout-content,
html.dark .layout-footer {
  background-color: #0f172a !important;
}

/* 页面头部 */
html.dark .page-header h1,
html.dark .page-header p {
  color: #ffffff !important;
}

/* Dashboard页面 */
html.dark .dashboard {
  background-color: #0f172a !important;
  color: #ffffff !important;
}

html.dark .dashboard * {
  color: #ffffff !important;
}

/* 强制所有文本为白色 - 最高优先级 */
html.dark * {
  color: #ffffff !important;
}

/* 保持按钮和链接的功能颜色 */
html.dark .n-button--primary,
html.dark .n-button--primary *,
html.dark .n-button--info,
html.dark .n-button--info *,
html.dark .n-button--success,
html.dark .n-button--success *,
html.dark .n-button--warning,
html.dark .n-button--warning *,
html.dark .n-button--error,
html.dark .n-button--error * {
  color: inherit !important;
}

html.dark a {
  color: #409eff !important;
}

html.dark a:hover {
  color: #66b1ff !important;
}

/* 侧边栏Logo和菜单 */
html.dark .logo-text {
  color: #ffffff !important;
}

html.dark .n-layout-sider {
  background-color: #0f172a !important;
}

/* 强制设置Naive UI组件的暗黑主题 */
html.dark .n-menu {
  background-color: #0f172a !important;
}

html.dark .n-menu .n-menu-item {
  color: #ffffff !important;
}

html.dark .n-menu .n-menu-item:hover {
  background-color: #1e293b !important;
}

html.dark .n-menu .n-menu-item.n-menu-item--selected {
  background-color: #409eff !important;
  color: #ffffff !important;
}

/* 头部导航 */
html.dark .n-layout-header {
  background-color: #0f172a !important;
  border-color: #334155 !important;
}

html.dark .header {
  background-color: #0f172a !important;
  color: #ffffff !important;
}

html.dark .breadcrumb .n-breadcrumb-item {
  color: #ffffff !important;
}

/* 卡片组件 */
html.dark .n-card {
  background-color: #1e293b !important;
  color: #ffffff !important;
  border-color: #334155 !important;
}

html.dark .n-card .n-card-header {
  background-color: #1e293b !important;
  color: #ffffff !important;
  border-color: #334155 !important;
}

html.dark .n-card .n-card__content {
  background-color: #1e293b !important;
  color: #ffffff !important;
}

/* 表格组件 */
html.dark .n-data-table {
  background-color: #1e293b !important;
  color: #ffffff !important;
}

html.dark .n-data-table .n-data-table-th {
  background-color: #334155 !important;
  color: #ffffff !important;
  border-color: #475569 !important;
}

html.dark .n-data-table .n-data-table-td {
  background-color: #1e293b !important;
  color: #ffffff !important;
  border-color: #334155 !important;
}

html.dark .n-data-table .n-data-table-tr:hover .n-data-table-td {
  background-color: #334155 !important;
}

/* 表单组件 */
html.dark .n-form-item-label {
  color: #ffffff !important;
}

html.dark .n-input {
  background-color: #334155 !important;
  color: #ffffff !important;
  border-color: #475569 !important;
}

html.dark .n-input .n-input__input-el {
  color: #ffffff !important;
  background-color: transparent !important;
}

html.dark .n-input .n-input__placeholder {
  color: #94a3b8 !important;
}

html.dark .n-select .n-base-selection {
  background-color: #334155 !important;
  color: #ffffff !important;
  border-color: #475569 !important;
}

html.dark .n-base-selection-label {
  color: #ffffff !important;
}

html.dark .n-base-selection-placeholder {
  color: #94a3b8 !important;
}

/* 按钮组件 - 只修改默认按钮，保持彩色按钮 */
html.dark .n-button:not(.n-button--primary):not(.n-button--info):not(.n-button--success):not(.n-button--warning):not(.n-button--error) {
  background-color: #334155 !important;
  color: #ffffff !important;
  border-color: #475569 !important;
}

html.dark .n-button:not(.n-button--primary):not(.n-button--info):not(.n-button--success):not(.n-button--warning):not(.n-button--error):hover {
  background-color: #475569 !important;
}

/* 分页组件 */
html.dark .n-pagination {
  color: #ffffff !important;
}

html.dark .n-pagination .n-pagination-item {
  background-color: #334155 !important;
  color: #ffffff !important;
  border-color: #475569 !important;
}

html.dark .n-pagination .n-pagination-item:hover {
  background-color: #475569 !important;
}

html.dark .n-pagination .n-pagination-item.n-pagination-item--active {
  background-color: #409eff !important;
  color: #ffffff !important;
}

/* 标签组件 - 保持语义颜色但确保文字可见 */
html.dark .n-tag {
  background-color: #334155 !important;
  color: #ffffff !important;
  border-color: #475569 !important;
}

/* 弹窗组件 */
html.dark .n-modal {
  background-color: rgba(0, 0, 0, 0.7) !important;
}

html.dark .n-dialog {
  background-color: #1e293b !important;
  color: #ffffff !important;
}

html.dark .n-dialog .n-dialog__title {
  color: #ffffff !important;
}

html.dark .n-dialog .n-dialog__content {
  color: #ffffff !important;
}

/* 消息组件 */
html.dark .n-message {
  background-color: #334155 !important;
  color: #ffffff !important;
}

html.dark .n-notification {
  background-color: #334155 !important;
  color: #ffffff !important;
}

/* 工具提示 */
html.dark .n-tooltip {
  background-color: #475569 !important;
  color: #ffffff !important;
}

/* 页面特定样式 */
html.dark .page-header h1,
html.dark .page-header h2,
html.dark .page-header h3,
html.dark .page-header h4,
html.dark .page-header h5,
html.dark .page-header h6 {
  color: #ffffff !important;
}

html.dark .page-header p {
  color: #e2e8f0 !important;
}

html.dark .table-title {
  color: #ffffff !important;
}

html.dark .table-header-content {
  color: #ffffff !important;
}

/* Dashboard页面特殊处理 */
html.dark .dashboard-container {
  background-color: #0f172a !important;
}

html.dark .stat-card {
  background-color: #1e293b !important;
  color: #ffffff !important;
}

html.dark .stat-value {
  color: #ffffff !important;
}

html.dark .stat-label {
  color: #e2e8f0 !important;
}

html.dark .chart-card {
  background-color: #1e293b !important;
  color: #ffffff !important;
}

html.dark .action-card {
  background-color: #1e293b !important;
  color: #ffffff !important;
}

html.dark .activity-card {
  background-color: #1e293b !important;
  color: #ffffff !important;
}

/* 系统管理页面 */
html.dark .system-card .n-card-header {
  color: #ffffff !important;
}

html.dark .n-descriptions .n-descriptions-table-wrapper .n-descriptions-table .n-descriptions-table-row .n-descriptions-table-row__label,
html.dark .n-descriptions .n-descriptions-table-wrapper .n-descriptions-table .n-descriptions-table-row .n-descriptions-table-row__content {
  color: #ffffff !important;
}

/* 下拉菜单 */
html.dark .n-dropdown-menu {
  background-color: #334155 !important;
  border-color: #475569 !important;
}

html.dark .n-dropdown-option {
  color: #ffffff !important;
}

html.dark .n-dropdown-option:hover {
  background-color: #475569 !important;
}

/* 上传组件 */
html.dark .n-upload {
  background-color: #334155 !important;
}

html.dark .n-upload-dragger {
  background-color: #334155 !important;
  border-color: #475569 !important;
  color: #ffffff !important;
}

/* 空状态 */
html.dark .n-empty {
  color: #e2e8f0 !important;
}

html.dark .n-empty .n-empty__description {
  color: #94a3b8 !important;
}

/* 加载组件 */
html.dark .n-spin {
  color: #ffffff !important;
}

/* 响应式优化 */
@media (max-width: 768px) {
  html.dark .page-header h1 {
    color: #ffffff !important;
  }
} 